package com.qf.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @propram: IntelliJ IDEA
 * @description: 分页的拦截器
 * @author: 秦先发
 * @create: 2021-09-24 17:09
 **/
@Configuration
public class MybatisPlusConfig {
    @Bean
    public   MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor interceptor  = new MybatisPlusInterceptor();
        interceptor .addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor ;
    }

}
